/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nl.hr.cmi.android.aanwezigheidsregistratie;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import nl.hr.cmi.android.aanwezigheidsregistratie.helper.WebserviceWrapper;

/**
 *
 * @author HP-laptop
 */
public class Settingscherm extends Activity {


    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
                
        this.setContentView(R.layout.settingscherm);

        // <editor-fold defaultstate="collapsed" desc="button change theme">
        final Button changelayoutbutton = (Button) findViewById(R.id.button_changelayout);
        changelayoutbutton.setOnClickListener(new Button.OnClickListener() {

            public void onClick(View v) {
               

            }
        });// </editor-fold>
        Spinner s = (Spinner) findViewById(R.id.docentenlijst);
        ArrayAdapter adapter;
        
        // Proberen om te connecten op via de webservice.
        try {
            adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item);

            String[] docenten = WebserviceWrapper.getDocenten();

            // Toevoegen aan adapter
            for (String docentcode : docenten) {
                adapter.add(docentcode);
            }
        } catch (Exception ex) {
            adapter = ArrayAdapter.createFromResource(this, R.array.docenten, android.R.layout.simple_spinner_item);
        }
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        s.setAdapter(adapter);

    }
}
